home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / vgatx10s.zip / VGATEXT.H < prev   
C/C++ Source or Header  |  1997-04-12  |  4KB  |  86 lines

  1. /*
  2.  * This file is part of the VgaText C++ Programming Library
  3.  *
  4.  * Copyright (c) 1995, 1997 by Branislav L. Slantchev
  5.  * A fine product of Silicon Creations, Inc. (gargoyle)
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the License which accompanies this
  9.  * software. This library is distributed in the hope that it will
  10.  * be useful, but without any warranty; without even the implied
  11.  * warranty of merchantability or fitness for a particular purpose.
  12.  *
  13.  * You should have received a copy of the License along with this
  14.  * library, in the file LICENSE.DOC; if not, write to the address
  15.  * below to receive a copy via electronic mail.
  16.  *
  17.  * You can reach Branislav L. Slantchev (Silicon Creations, Inc.)
  18.  * at bslantch@cs.angelo.edu. The file SUPPORT.DOC has the current
  19.  * telephone numbers and the postal address for contacts.
  20. */
  21. #ifndef INCLUDED_VGATEXT_H
  22. #define INCLUDED_VGATEXT_H
  23.  
  24. /*
  25.  * v g a   t e x t   m o d e   e f f e c t s   c l a s s
  26.  * ──────────────────────────────────────────────────────────────────────────
  27.  * special vga text mode color effects (direct video bios manipulation class)
  28. */
  29. #include "typedef.h"
  30.  
  31. class zVgaText
  32. {
  33. public:
  34.     zVgaText();
  35.     ~zVgaText();
  36.  
  37.     static Boolean Detect();  // try to detect a VGA card
  38.     static Boolean restoreBlink; // True if we need to restore the blinking
  39.  
  40.     static void resume();  // installs the custom timer handler/palettes
  41.     static void suspend(); // suspends the operation of the effects
  42.     static void enable();  // enables the timer intercept handler
  43.     static void disable(char nPalette = 0); // disables the timer handler
  44.  
  45.     static void PulseColor(char attr, char aDelta); // create pulse def
  46.     static void PulseColor(char attr, char delta, char nStart, char nEnd);
  47.     static void SetColor(char attr, char rgb[3]); // set a color definition
  48.     static void SetColor(char attr, char rgb[3], char nStart, char nEnd);
  49.     static void GradeColor(char attr, char rgb[3]); // grade a color
  50.     static void GradeColor(char attr, char rgb[3], char nStart, char nEnd);
  51.     static void BlinkSim(char attr); // simulated software blinking
  52.     static void FadeOut(char aDelay = 12);  // fades out the whole palette
  53.     static void FadeIn(char aDelay = 12); // fades in the whole palette
  54.  
  55.     static void ResetPalettes();  // reset user DAC palettes to original
  56.     static void LoadPalettes();   // load the user DAC palettes into the VGA
  57.     static void EnableBlink(Boolean enable);  // enable/disable blinking
  58.     static void SetDelay(ushort nTicks);  // sets tick delay for handler
  59.     static void SetDelta(char nDelta); // set the delta skip step
  60.  
  61. protected:
  62.     static uchar *GetDacPtr(char attrib, char palette);  // attrib pos in DAC
  63.     static void   CalcScale(char rgbStart[3], char rgbEnd[3], char nRange);
  64.     static uchar  dac[768]; // user-modifiable rgb values
  65.     static uchar  pal[17];  // user-modifiable vga palette
  66.     static ushort delayTicks; // delay ticks for the timer intercept
  67.     static ushort countdown;  // current tick countdown used by the handler
  68.     static char   delta;      // number of palettes to skip over
  69.     static char   nCurPalette;  // the current palette (0..15)
  70.  
  71. private:
  72.     static uchar origDac[768]; // original DAC rgb values
  73.     static uchar origPal[17];  // original VGA color registers
  74.     static uchar origPageMode;  // original VGA paging mode
  75.     static uchar origDispPage;  // original active display page
  76.  
  77.     static void interrupt (*timerVector)(...);  // save vector for INT9
  78.     static void interrupt timerHandler(...);    // our very own handler
  79.  
  80.     static Boolean vgaCard;     // True if VGA is detected, False otherwise
  81.     static Boolean initVga;     // True if initialized, False otherwise
  82.     static Boolean timerSet;    // True if the timer INT is intercepted
  83. };
  84.  
  85. #endif /* INCLUDED_VGATEXT_H */
  86.